<?php
$frontView = $data['frontview'];

//for advance mode
$premium_fileds = array('premium', 'premium_items', 'video_type');

# $programme_cat  =  $data['rootcategory']; 
?>
<div id="pop-find" class="popup">

    <div class="programme">

    <?php
    if (!empty($frontView['programme'])	&&	is_array($frontView['programme'])) {
    	$search_fields = $frontView['programme'];

    ?>

        <form method="get" action="pms_list.html" name="find" class="simple-form">
            <input type="hidden" name="premium" value="0" /><input type="hidden" name="unpublish" value="0" />
            <input type="hidden" name="type" value="programme" />
            <fieldset class="ui-widget-content">

                <div class="legend">                
                    <span class="ui-widget-header mode-btn simple-btn">Simple Mode</span>
                    <span class="ui-widget-header mode-btn advance-btn">Advance Mode</span>
                </div>

            <?php
            	foreach ($search_fields as	$value	=>	$view) {
                    $name = "searchString[$value]";
            ?>
                <div class="form-item">
                    <span class="grid-l">
                        <label><?php echo $view; ?></label> :                         
                    </span>
                    <span class="grid-r">
                        <?php FormHelper::HiddenField("searchField[$value]", $value) ?>
                        <?php FormHelper::HiddenField("searchOper[$value]", 'eq') ?>
                        <?php if ( $value == 'programme_id' || (!array_key_exists('programme_id', $search_fields) && $value == 'id')){ ?>
                            <input type="text" name="<?php echo $name;?>" class="text" autocomplete="off" id="find2_programme_id" />
                        <?php } elseif ($value == 'title'){?>
                            <input type="text" name="<?php echo $name;?>" class="text" autocomplete="off" id="find2_programme_title" />
                        <?php } elseif ($value == 'path'){?>
                            <input type="text" name="<?php echo $name;?>" class="text" autocomplete="off" id="find2_programme_path" />
                        <?php } elseif ($value == 'tvbcom_category'){?>
                            <input type="text" name="<?php echo $name;?>" class="text" autocomplete="off" id="find2_tvbcom_category" />
                        <?php } elseif ($value == 'premium'){?>
                            <label>All<input class="premium" type="radio" name="<?php echo $name;?>" value="2" checked="checked"></label>
                            <label>Yes<input class="premium" type="radio" name="<?php echo $name;?>" value="1"></label>
                            <label>No<input class="premium" type="radio" name="<?php echo $name;?>"  value="0"></label>
                        <?php } elseif ($value == 'premium_items'){?>
                            <label><input type="checkbox" name="<?php echo $name;?>[]" value="subscription_flag">Subscription</label>
                            <label><input type="checkbox" name="<?php echo $name;?>[]" value="ppv_flag">Pay-Per-View</label>
                        <?php } elseif ($value == 'video_type'){?>
                            <label>All<input type="radio" name="<?php echo $name;?>" value="all" checked="checked"></label>
                            <label>I-Version<input type="radio" name="<?php echo $name;?>" value="I"></label>
                            <label>O-Version<input type="radio" name="<?php echo $name;?>" value="O"></label>
                        <?php } else {?>
                            <input type="text" name="<?php echo $name;?>" class="text" />
                        <?php } ?>
                    </span>
                </div>
            <?php
            	}
            ?>

            </fieldset>
            <span class="buttons">
    		    <?php FormHelper::SubmitButton('submit', 'Find') ?>
    		    <?php FormHelper::ResetButton('', 'Reset') ?>
    		    <?php FormHelper::Button('', 'All') ?>
            </span>
        </form>


        <form method="get" action="pms_list.html" name="find" class="advance-form">
            <input type="hidden" name="premium" value="0" /><input type="hidden" name="unpublish" value="0" />
            <input type="hidden" name="type" value="programme" />
            <fieldset class="ui-widget-content">
                
                <div class="legend">                
                    <span class="ui-widget-header mode-btn simple-btn">Simple Mode</span>
                    <span class="ui-widget-header mode-btn advance-btn">Advance Mode</span>
                </div>

                <div class="form-item filter-item">
                    <span class="grid-l">
                        <label>Filters</label> :                         
                    </span>
                    <span class="grid-r">
                        <span class="filter-line">
                            <select class="searchField" name="searchField[]">
								<option value="">Please Select...</option>
                            <?php
                            	foreach ($search_fields as	$value	=>	$view) {
                                    if (!in_array($value, $premium_fileds)) {
                            ?>
								<option value="<?php echo $value;?>"><?php echo $view;?></option>
                            <?php
                                    }
                                }
                            ?>
                            </select>
                            <select class="searchOper" name="searchOper[]">
                                <option value="bw">begins with</option>
                                <option value="eq">equal</option>
                                <option value="ne">not equal</option>
                                <option value="lt">less</option>
                                <option value="le">less or equal</option>
                                <option value="gt">greater</option>
                                <option value="ge">greater or equal</option>
                                <option value="ew">ends with</option>
                                <option value="cn">contains</option>
                            </select>
                            <input class="searchString" type="text" name="searchString[]" value="" />                        
                            <a class="removeFilter btn ui-state-default ui-corner-all" href="#"><span class="ui-icon ui-icon-minus"></span></a>
                        </span>
                    </span>
                </div>
                <div class="form-item">
                    <span class="grid-l">&nbsp;</span>        
                    <span class="grid-r">
                        <a class="addFilter btn ui-state-default ui-corner-all" href="#"><span class="ui-icon ui-icon-plus"></span></a>
                    </span>
                </div>

            <?php
                foreach ($search_fields as	$value	=>	$view) {
                    if (in_array($value, $premium_fileds)) {
                        $name = "searchString[$value]";
            ?>
                <div class="form-item clear">
                    <span class="grid-l">
                        <label><?php echo $view; ?></label> :                         
                    </span>
                    <span class="grid-r">
                        <?php FormHelper::HiddenField("searchField[$value]", $value) ?>
                        <?php FormHelper::HiddenField("searchOper[$value]", 'eq') ?>
                        <?php if ($value == 'premium'){?>
                            <label>All<input class="premium" type="radio" name="<?php echo $name;?>" value="2" checked="checked"></label>
                            <label>Yes<input class="premium" type="radio" name="<?php echo $name;?>" value="1"></label>
                            <label>No<input class="premium" type="radio" name="<?php echo $name;?>"  value="0"></label>
                        <?php } elseif ($value == 'premium_items'){?>
                            <label><input type="checkbox" name="<?php echo $name;?>[]" value="subscription_flag">Subscription</label>
                            <label><input type="checkbox" name="<?php echo $name;?>[]" value="ppv_flag">Pay-Per-View</label>
                        <?php } elseif ($value == 'video_type'){?>
                            <label>All<input type="radio" name="<?php echo $name;?>" value="all" checked="checked"></label>
                            <label>I-Version<input type="radio" name="<?php echo $name;?>" value="I"></label>
                            <label>O-Version<input type="radio" name="<?php echo $name;?>" value="O"></label>
                        <?php } ?>
                    </span>
                </div>
            <?php
                    }
                }
            ?>

            </fieldset>
            <span class="buttons">
    		    <?php FormHelper::SubmitButton('submit', 'Find') ?>
    		    <?php FormHelper::ResetButton('', 'Reset') ?>
    		    <?php FormHelper::Button('', 'All') ?>
            </span>
        </form>

    <?php
        }
    ?>
    </div>
    
    <div class="episode">

    <?php
    if (!empty($frontView['episode'])	&&	is_array($frontView['episode'])) {
    	$search_fields = $frontView['episode'];

    ?>

        <form method="get" action="pms_list.html" name="find" class="simple-form">
            <input type="hidden" name="premium" value="0" /><input type="hidden" name="unpublish" value="0" />
            <input type="hidden" name="type" value="episode" />
            <fieldset class="ui-widget-content">

                <div class="legend">                
                    <span class="ui-widget-header mode-btn simple-btn">Simple Mode</span>
                    <span class="ui-widget-header mode-btn advance-btn">Advance Mode</span>
                </div>

            <?php
            	foreach ($search_fields as	$value	=>	$view) {
                    $name = "searchString[$value]";
            ?>
                <div class="form-item">
                    <span class="grid-l">
                        <label><?php echo $view; ?></label> :                         
                    </span>
                    <span class="grid-r">
                        <?php FormHelper::HiddenField("searchField[$value]", $value) ?>
                        <?php FormHelper::HiddenField("searchOper[$value]", 'eq') ?>
                        <?php if ( $value == 'programme_id' || (!array_key_exists('programme_id', $search_fields) && $value == 'id')){ ?>
                            <input type="text" name="<?php echo $name;?>" class="text" autocomplete="off" id="find2_programme_id" />
                        <?php } elseif ($value == 'title'){?>
                            <input type="text" name="<?php echo $name;?>" class="text" autocomplete="off" id="find2_programme_title" />
                        <?php } elseif ($value == 'path'){?>
                            <input type="text" name="<?php echo $name;?>" class="text" autocomplete="off" id="find2_programme_path" />
                        <?php } elseif ($value == 'tvbcom_category'){?>
                            <input type="text" name="<?php echo $name;?>" class="text" autocomplete="off" id="find2_tvbcom_category" />
                        <?php } elseif ($value == 'premium'){?>
                            <label>All<input class="premium" type="radio" name="<?php echo $name;?>" value="2" checked="checked"></label>
                            <label>Yes<input class="premium" type="radio" name="<?php echo $name;?>" value="1"></label>
                            <label>No<input class="premium" type="radio" name="<?php echo $name;?>"  value="0"></label>
                        <?php } elseif ($value == 'premium_items'){?>
                            <label><input type="checkbox" name="<?php echo $name;?>[]" value="subscription_flag">Subscription</label>
                            <label><input type="checkbox" name="<?php echo $name;?>[]" value="ppv_flag">Pay-Per-View</label>
                        <?php } elseif ($value == 'video_type'){?>
                            <label>All<input type="radio" name="<?php echo $name;?>" value="all" checked="checked"></label>
                            <label>I-Version<input type="radio" name="<?php echo $name;?>" value="I"></label>
                            <label>O-Version<input type="radio" name="<?php echo $name;?>" value="O"></label>
                        <?php } else {?>
                            <input type="text" name="<?php echo $name;?>" class="text" />
                        <?php } ?>
                    </span>
                </div>
            <?php
            	}
            ?>

            </fieldset>
            <span class="buttons">
    		    <?php FormHelper::SubmitButton('submit', 'Find') ?>
    		    <?php FormHelper::ResetButton('', 'Reset') ?>
    		    <?php FormHelper::Button('', 'All') ?>
            </span>
        </form>
        
        <form method="get" action="pms_list.html" name="find" class="advance-form">
            <input type="hidden" name="premium" value="0" /><input type="hidden" name="unpublish" value="0" />
            <input type="hidden" name="type" value="episode" />
            <fieldset class="ui-widget-content">

                <div class="legend">                
                    <span class="ui-widget-header mode-btn simple-btn">Simple Mode</span>
                    <span class="ui-widget-header mode-btn advance-btn">Advance Mode</span>
                </div>

                <?php # FormHelper::TextField('programme_id', '', 'Programme') ?>

                <div class="form-item filter-item">
                    <span class="grid-l">
                        <label>Filters</label> :                         
                    </span>
                    <span class="grid-r">
                        <span class="filter-line">
                            <select class="searchField" name="searchField[]">
								<option value="">Please Select...</option>
                            <?php
                            	foreach ($search_fields as	$value	=>	$view) {
                                    if (!in_array($value, $premium_fileds)) {
                            ?>
								<option value="<?php echo $value;?>"><?php echo $view;?></option>
                            <?php
                                    }
                                }
                            ?>
                            </select>
                            <select class="searchOper" name="searchOper[]">
                                <option value="bw">begins with</option>
                                <option value="eq">equal</option>
                                <option value="ne">not equal</option>
                                <option value="lt">less</option>
                                <option value="le">less or equal</option>
                                <option value="gt">greater</option>
                                <option value="ge">greater or equal</option>
                                <option value="ew">ends with</option>
                                <option value="cn">contains</option>
                            </select>
                            <input class="searchString" type="text" name="searchString[]" value="" />                        
                            <a class="removeFilter btn ui-state-default ui-corner-all" href="#"><span class="ui-icon ui-icon-minus"></span></a>
                        </span>
                    </span>
                </div>
                <div class="form-item">
                    <span class="grid-l">
                        &nbsp;                         
                    </span>
                    <span class="grid-r">
                        <a class="addFilter btn ui-state-default ui-corner-all" href="#"><span class="ui-icon ui-icon-plus"></span></a>
                    </span>
                </div>

            <?php
                foreach ($search_fields as	$value	=>	$view) {
                    if (in_array($value, $premium_fileds)) {
                        $name = "searchString[$value]";
            ?>
                <div class="form-item clear">
                    <span class="grid-l">
                        <label><?php echo $view; ?></label> :                         
                    </span>
                    <span class="grid-r">
                        <?php FormHelper::HiddenField("searchField[$value]", $value) ?>
                        <?php FormHelper::HiddenField("searchOper[$value]", 'eq') ?>
                        <?php if ($value == 'premium'){?>
                            <label>All<input class="premium" type="radio" name="<?php echo $name;?>" value="2" checked="checked"></label>
                            <label>Yes<input class="premium" type="radio" name="<?php echo $name;?>" value="1"></label>
                            <label>No<input class="premium" type="radio" name="<?php echo $name;?>"  value="0"></label>
                        <?php } elseif ($value == 'premium_items'){?>
                            <label><input type="checkbox" name="<?php echo $name;?>[]" value="subscription_flag">Subscription</label>
                            <label><input type="checkbox" name="<?php echo $name;?>[]" value="ppv_flag">Pay-Per-View</label>
                        <?php } elseif ($value == 'video_type'){?>
                            <label>All<input type="radio" name="<?php echo $name;?>" value="all" checked="checked"></label>
                            <label>I-Version<input type="radio" name="<?php echo $name;?>" value="I"></label>
                            <label>O-Version<input type="radio" name="<?php echo $name;?>" value="O"></label>
                        <?php } ?>
                    </span>
                </div>
            <?php
                    }
                }
            ?>

            </fieldset>
            <span class="buttons">
    		    <?php FormHelper::SubmitButton('submit', 'Find') ?>
    		    <?php FormHelper::ResetButton('', 'Reset') ?>
    		    <?php FormHelper::Button('', 'All') ?>
            </span>
        </form>

    <?php
        }
    ?>

    </div>
       
    <div class="cast">
        <form method="get" action="pms_list.html" name="find" class="simple-form">
            <input type="hidden" name="premium" value="0" /><input type="hidden" name="unpublish" value="0" />
            <input type="hidden" name="type" value="cast" />
            <fieldset class="ui-widget-content">

                <div class="legend">                
                    <span class="ui-widget-header mode-btn simple-btn">Simple Mode</span>
                    <span class="ui-widget-header mode-btn advance-btn">Advance Mode</span>
                </div>

<?php
if (!empty($frontView['cast'])	&&	is_array($frontView['cast']))
{
	$search_fields = $frontView['cast'];
	foreach ($search_fields as	$value	=>	$view)
	{
?>
                <div class="form-item">
                    <span class="grid-l">
                        <label><?php echo $view; ?></label> :                         
                    </span>
                    <span class="grid-r">
                        <?php FormHelper::HiddenField('searchField[]', $value) ?>
                        <?php FormHelper::HiddenField('searchOper[]', 'eq') ?>
                        <?php if ( $value == 'programme_id' || (!array_key_exists('programme_id', $search_fields) && $value == 'id')){ ?>
                            <input type="text" name="searchString[]" class="text" autocomplete="off" id="find2_programme_id" />
                        <?php } elseif ($value == 'title'){?>
                            <input type="text" name="searchString[]" class="text" autocomplete="off" id="find2_programme_title" />
                        <?php } elseif ($value == 'path'){?>
                            <input type="text" name="searchString[]" class="text" autocomplete="off" id="find2_programme_path" />
                        <?php } elseif ($value == 'tvbcom_category'){?>
                            <input type="text" name="searchString[]" class="text" autocomplete="off" id="find2_tvbcom_category" />
                        <?php } else {?>
                            <input type="text" name="searchString[]" class="text" />
                        <?php } ?>
                    </span>
                </div>
<?php
	}
}
?>

            </fieldset>
            <span class="buttons">
    		    <?php FormHelper::SubmitButton('submit', 'Find') ?>
    		    <?php FormHelper::ResetButton('', 'Reset') ?>
    		    <?php FormHelper::Button('', 'All') ?>
            </span>
        </form>
        
        <form method="get" action="pms_list.html" name="find" class="advance-form">
            <input type="hidden" name="premium" value="0" /><input type="hidden" name="unpublish" value="0" />
            <input type="hidden" name="type" value="cast" />
            <fieldset class="ui-widget-content">

                <div class="legend">                
                    <span class="ui-widget-header mode-btn simple-btn">Simple Mode</span>
                    <span class="ui-widget-header mode-btn advance-btn">Advance Mode</span>
                </div>

                <?php # FormHelper::TextField('programme_id', '', 'Programme') ?>

                <div class="form-item filter-item">
                    <span class="grid-l">
                        <label>Filters</label> :                         
                    </span>
                    <span class="grid-r">
                        <span class="filter-line">
                            <select class="searchField" name="searchField[]">
								<option value="">Please Select...</option>
<?php
if (!empty($frontView['cast'])	&&	is_array($frontView['cast']))
{
	foreach ($frontView['cast'] as	$value	=>	$view)
	{
?>
								<option value="<?php echo $value;?>"><?php echo $view;?></option>
<?php
	}
}
?>
                            </select>
                            <select class="searchOper" name="searchOper[]">
                                <option value="bw">begins with</option>
                                <option value="eq">equal</option>
                                <option value="ne">not equal</option>
                                <option value="lt">less</option>
                                <option value="le">less or equal</option>
                                <option value="gt">greater</option>
                                <option value="ge">greater or equal</option>
                                <option value="ew">ends with</option>
                                <option value="cn">contains</option>
                            </select>
                            <input class="searchString" type="text" name="searchString[]" value="" />                        
                            <a class="removeFilter btn ui-state-default ui-corner-all" href="#"><span class="ui-icon ui-icon-minus"></span></a>
                        </span>
                    </span>
                </div>
                <div class="form-item">
                    <span class="grid-l">
                        &nbsp;                         
                    </span>
                    <span class="grid-r">
                        <a class="addFilter btn ui-state-default ui-corner-all" href="#"><span class="ui-icon ui-icon-plus"></span></a>
                    </span>
                </div>
            </fieldset>
            <span class="buttons">
    		    <?php FormHelper::SubmitButton('submit', 'Find') ?>
    		    <?php FormHelper::ResetButton('', 'Reset') ?>
    		    <?php FormHelper::Button('', 'All') ?>
            </span>
        </form>
    </div>
        
    <div class="image">
        <form method="get" action="pms_list.html" name="find" class="simple-form">
            <input type="hidden" name="premium" value="0" /><input type="hidden" name="unpublish" value="0" />
            <input type="hidden" name="type" value="image" />
            <fieldset class="ui-widget-content">

                <div class="legend">                
                    <span class="ui-widget-header mode-btn simple-btn">Simple Mode</span>
                    <span class="ui-widget-header mode-btn advance-btn">Advance Mode</span>
                </div>

<?php
if (!empty($frontView['image'])	&&	is_array($frontView['image']))
{
	$search_fields = $frontView['image'];
	foreach ($search_fields as	$value	=>	$view)
	{
?>
                <div class="form-item">
                    <span class="grid-l">
                        <label><?php echo $view; ?></label> :                         
                    </span>
                    <span class="grid-r">
                        <?php FormHelper::HiddenField('searchField[]', $value) ?>
                        <?php FormHelper::HiddenField('searchOper[]', 'eq') ?>
                        <?php if ( $value == 'programme_id' || (!array_key_exists('programme_id', $search_fields) && $value == 'id')){ ?>
                            <input type="text" name="searchString[]" class="text" autocomplete="off" id="find2_programme_id" />
                        <?php } elseif ($value == 'title'){?>
                            <input type="text" name="searchString[]" class="text" autocomplete="off" id="find2_programme_title" />
                        <?php } elseif ($value == 'path'){?>
                            <input type="text" name="searchString[]" class="text" autocomplete="off" id="find2_programme_path" />
                        <?php } elseif ($value == 'folder_id'){?>
                            <select id="find2_folder" name="searchString[]" disabled="disabled"></select>
                        <?php } elseif ($value == 'tvbcom_category'){?>
                            <input type="text" name="searchString[]" class="text" autocomplete="off" id="find2_tvbcom_category" />
                        <?php } else {?>
                            <input type="text" name="searchString[]" class="text" />
                        <?php } ?>
                    </span>
                </div>
<?php
	}
}
?>

            </fieldset>
            <span class="buttons">
    		    <?php FormHelper::SubmitButton('submit', 'Find') ?>
    		    <?php FormHelper::ResetButton('', 'Reset') ?>
    		    <?php FormHelper::Button('', 'All') ?>
            </span>
        </form>
        
        <form method="get" action="pms_list.html" name="find" class="advance-form">
            <input type="hidden" name="premium" value="0" /><input type="hidden" name="unpublish" value="0" />
            <input type="hidden" name="type" value="image" />
            <fieldset class="ui-widget-content">

                <div class="legend">                
                    <span class="ui-widget-header mode-btn simple-btn">Simple Mode</span>
                    <span class="ui-widget-header mode-btn advance-btn">Advance Mode</span>
                </div>

                <div class="form-item filter-item">
                    <span class="grid-l">
                        <label>Filters</label> :                         
                    </span>
                    <span class="grid-r">
                        <span class="filter-line">
                            <select class="searchField" name="searchField[]">
								<option value="">Please Select...</option>
<?php
if (!empty($frontView['image'])	&&	is_array($frontView['image']))
{
	foreach ($frontView['image'] as	$value	=>	$view)
	{
?>
								<option value="<?php echo $value;?>"><?php echo $view;?></option>
<?php
	}
}
?>
                            </select>
                            <select class="searchOper" name="searchOper[]">
                                <option value="bw">begins with</option>
                                <option value="eq">equal</option>
                                <option value="ne">not equal</option>
                                <option value="lt">less</option>
                                <option value="le">less or equal</option>
                                <option value="gt">greater</option>
                                <option value="ge">greater or equal</option>
                                <option value="ew">ends with</option>
                                <option value="cn">contains</option>
                            </select>
                            <input class="searchString" type="text" name="searchString[]" value="" />                        
                            <a class="removeFilter btn ui-state-default ui-corner-all" href="#"><span class="ui-icon ui-icon-minus"></span></a>
                        </span>
                    </span>
                </div>
                <div class="form-item">
                    <span class="grid-l">
                        &nbsp;                         
                    </span>
                    <span class="grid-r">
                        <a class="addFilter btn ui-state-default ui-corner-all" href="#"><span class="ui-icon ui-icon-plus"></span></a>
                    </span>
                </div>
            </fieldset>
            <span class="buttons">
    		    <?php FormHelper::SubmitButton('submit', 'Find') ?>
    		    <?php FormHelper::ResetButton('', 'Reset') ?>
    		    <?php FormHelper::Button('', 'All') ?>
            </span>
        </form>
    </div>
    
    <div class="video">

    <?php
        if (!empty($frontView['video'])	&&	is_array($frontView['video'])) {
        	$search_fields = $frontView['video'];
    ?>

        <form method="get" action="pms_list.html" name="find" class="simple-form">
            <input type="hidden" name="premium" value="0" /><input type="hidden" name="unpublish" value="0" />
            <input type="hidden" name="type" value="video" />
            <fieldset class="ui-widget-content">

                <div class="legend">                
                    <span class="ui-widget-header mode-btn simple-btn">Simple Mode</span>
                    <span class="ui-widget-header mode-btn advance-btn">Advance Mode</span>
                </div>

                <?php
                	foreach ($search_fields as	$value	=>	$view) {
                        $name = "searchString[$value]";
                ?>
                <div class="form-item">
                    <span class="grid-l">
                        <label><?php echo $view; ?></label> :                         
                    </span>
                    <span class="grid-r">
                        <?php FormHelper::HiddenField("searchField[$value]", $value) ?>
                        <?php FormHelper::HiddenField("searchOper[$value]", 'eq') ?>
                        <?php if ( $value == 'programme_id' || (!array_key_exists('programme_id', $search_fields) && $value == 'id')){ ?>
                            <input type="text" name="<?php echo $name;?>" class="text" autocomplete="off" id="find2_programme_id" />
                        <?php } elseif ($value == 'title'){?>
                            <input type="text" name="<?php echo $name;?>" class="text" autocomplete="off" id="find2_programme_title" />
                        <?php } elseif ($value == 'path'){?>
                            <input type="text" name="<?php echo $name;?>" class="text" autocomplete="off" id="find2_programme_path" />
                        <?php } elseif ($value == 'tvbcom_category'){?>
                            <input type="text" name="<?php echo $name;?>" class="text" autocomplete="off" id="find2_tvbcom_category" />
                        <?php } elseif ($value == 'folder_id'){?>
                            <select id="find2_folder" name="<?php echo $name;?>" disabled="disabled"></select>
                        <?php } elseif ($value == 'premium'){?>
                            <label>All<input class="premium" type="radio" name="<?php echo $name;?>" value="2" checked="checked"></label>
                            <label>Yes<input class="premium" type="radio" name="<?php echo $name;?>" value="1"></label>
                            <label>No<input class="premium" type="radio" name="<?php echo $name;?>"  value="0"></label>
                        <?php } elseif ($value == 'premium_items'){?>
                            <label><input type="checkbox" name="<?php echo $name;?>[]" value="subscription_flag">Subscription</label>
                            <label><input type="checkbox" name="<?php echo $name;?>[]" value="ppv_flag">Pay-Per-View</label>
                        <?php } elseif ($value == 'video_type'){?>
                            <label>All<input type="radio" name="<?php echo $name;?>" value="all" checked="checked"></label>
                            <label>I-Version<input type="radio" name="<?php echo $name;?>" value="I"></label>
                            <label>O-Version<input type="radio" name="<?php echo $name;?>" value="O"></label>
                        <?php } else {?>
                            <input type="text" name="<?php echo $name;?>" class="text" />
                        <?php } ?>
                    </span>
                </div>
                <?php
                	}
                ?>

            </fieldset>
            <span class="buttons">
    		    <?php FormHelper::SubmitButton('submit', 'Find') ?>
    		    <?php FormHelper::ResetButton('', 'Reset') ?>
    		    <?php FormHelper::Button('', 'All') ?>
            </span>
        </form>
        
        <form method="get" action="pms_list.html" name="find" class="advance-form">
            <input type="hidden" name="premium" value="0" /><input type="hidden" name="unpublish" value="0" />
            <input type="hidden" name="type" value="video" />
            <fieldset class="ui-widget-content">

                <div class="legend">                
                    <span class="ui-widget-header mode-btn simple-btn">Simple Mode</span>
                    <span class="ui-widget-header mode-btn advance-btn">Advance Mode</span>
                </div>

                <div class="form-item filter-item">
                    <span class="grid-l">
                        <label>Filters</label> :                         
                    </span>
                    <span class="grid-r">
                        <span class="filter-line">
                            <select class="searchField" name="searchField[]">
								<option value="">Please Select...</option>
                            <?php
                            	foreach ($search_fields as	$value	=>	$view) {
                                    if (!in_array($value, $premium_fileds)) {
                            ?>
								<option value="<?php echo $value;?>"><?php echo $view;?></option>
                            <?php
                                    }
                                }
                            ?>
                            </select>
                            <select class="searchOper" name="searchOper[]">
                                <option value="bw">begins with</option>
                                <option value="eq">equal</option>
                                <option value="ne">not equal</option>
                                <option value="lt">less</option>
                                <option value="le">less or equal</option>
                                <option value="gt">greater</option>
                                <option value="ge">greater or equal</option>
                                <option value="ew">ends with</option>
                                <option value="cn">contains</option>
                            </select>
                            <input class="searchString" type="text" name="searchString[]" value="" />                        
                            <a class="removeFilter btn ui-state-default ui-corner-all" href="#"><span class="ui-icon ui-icon-minus"></span></a>
                        </span>
                    </span>
                </div>
                <div class="form-item">
                    <span class="grid-l">
                        &nbsp;                         
                    </span>
                    <span class="grid-r">
                        <a class="addFilter btn ui-state-default ui-corner-all" href="#"><span class="ui-icon ui-icon-plus"></span></a>
                    </span>
                </div>

            <?php
                foreach ($search_fields as	$value	=>	$view) {
                    if (in_array($value, $premium_fileds)) {
                        $name = "searchString[$value]";
            ?>
                <div class="form-item clear">
                    <span class="grid-l">
                        <label><?php echo $view; ?></label> :                         
                    </span>
                    <span class="grid-r">
                        <?php FormHelper::HiddenField("searchField[$value]", $value) ?>
                        <?php FormHelper::HiddenField("searchOper[$value]", 'eq') ?>
                        <?php if ($value == 'premium'){?>
                            <label>All<input class="premium" type="radio" name="<?php echo $name;?>" value="2" checked="checked"></label>
                            <label>Yes<input class="premium" type="radio" name="<?php echo $name;?>" value="1"></label>
                            <label>No<input class="premium" type="radio" name="<?php echo $name;?>"  value="0"></label>
                        <?php } elseif ($value == 'premium_items'){?>
                            <label><input type="checkbox" name="<?php echo $name;?>[]" value="subscription_flag">Subscription</label>
                            <label><input type="checkbox" name="<?php echo $name;?>[]" value="ppv_flag">Pay-Per-View</label>
                        <?php } elseif ($value == 'video_type'){?>
                            <label>All<input type="radio" name="<?php echo $name;?>" value="all" checked="checked"></label>
                            <label>I-Version<input type="radio" name="<?php echo $name;?>" value="I"></label>
                            <label>O-Version<input type="radio" name="<?php echo $name;?>" value="O"></label>
                        <?php } ?>
                    </span>
                </div>
            <?php
                    }
                }
            ?>

            </fieldset>
            <span class="buttons">
    		    <?php FormHelper::SubmitButton('submit', 'Find') ?>
    		    <?php FormHelper::ResetButton('', 'Reset') ?>
    		    <?php FormHelper::Button('', 'All') ?>
            </span>
        </form>

    <?php
        }
    ?>

    </div>
    
    <div class="info address recipe song biography award product qa general_info pageant">
        <form method="get" action="pms_list.html" name="find">
            <input type="hidden" name="premium" value="0" /><input type="hidden" name="unpublish" value="0" /> 
            <input type="hidden" name="type" value="" />
            <input id="find_programme_eps" name="" type="hidden" value="" />
            <fieldset class="ui-widget-content">

                <legend class="ui-widget-header">Find</legend>
                
                <div class="form-item">
                    <span class="grid-l"><label><ins>*</ins>Programme ID</label> :</span>
                    <span class="grid-r">
                        <input id="find_programme_id" name="programme_id" type="text" class="text" autocomplete="off" value="" />
                    </span>
                </div>

                <div class="form-item">
                    <span class="grid-l"><label><ins>**</ins>Programme Title (Chinese)</label> :</span>
                    <span class="grid-r">
                        <input id="find_programme_title_cn" name="find_programme_title_cn" type="text" class="text" autocomplete="off" value="" />
                    </span>
                </div>
    
                <div class="form-item">
                    <span class="grid-l"><label><ins>**</ins>Programme Title (English)</label> :</span>
                    <span class="grid-r">
                        <input id="find_programme_title_en" name="find_programme_title_en" type="text" class="text" autocomplete="off" value="" /> 
                    </span>
                </div>
    
                <div class="form-item">
                    <span class="grid-l"><label><ins>*</ins>Programme Path</label> :</span>
                    <span class="grid-r">
                        <input id="find_programme_path" name="find_programme_path" type="text" class="text" autocomplete="off" value="" /> 
                    </span>
                </div>
                
                <div class="form-item">
                    <span class="grid-l"><label>On Air Episode No.</label> :</span>
                    <span class="grid-r">
                        <input id="find_onair_episode_no" name="onair_episode_no" type="text" class="text" value="" /> 
                    </span>
                </div>
        
            </fieldset>
            <span class="buttons">
    		    <?php FormHelper::SubmitButton('submit', 'Find') ?>
    		    <?php FormHelper::ResetButton('', 'Reset') ?>
            </span>
        </form>
    </div>
    
</div>
